import { pubRequire } from '@utils/public'
const baseUrl = '/system/parameters'
/* 参数管理获取列表 */
export function getSearchList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/* 批量删除*/
export function batchRemove(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}`, obj, callbBack, errBack)
}
/* 单个删除*/
export function deleteReq(id, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, id, callbBack, errBack)
}
/*编辑时获取表单详情*/
export function editForm(configId, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${configId}`, '', callbBack, errBack)
}
/* 校验参数键名 */
export function parameterName(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/verifications`, obj, callbBack, errBack)
}
/*新增表单提交*/
export function addConfig(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
/*编辑表单提交*/
export function editConfig(configId, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${configId}`, obj, callbBack, errBack)
}
/*根据参数配置key获取value*/
export function getKeyValue(params, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/options`, params, callbBack, errBack)
}
